﻿#include "mainpopdialog.h"
#include "ui_mainpopdialog.h"

MainPopDialog::MainPopDialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::MainPopDialog)
{
    ui->setupUi(this);
    //ui->treeWidget->expandAll();

    m_pSelfMarketDlg = new SelfMarketDialog();


    ui->tabWidget->insertTab(0,m_pSelfMarketDlg,QStringLiteral("自选行情"));
    ui->tabWidget->removeTab(1);
    ui->tabWidget->removeTab(1);

    ui->tabWidget->setCornerWidget(0);

    connect(((SelfMarketDialog*)m_pSelfMarketDlg),SIGNAL(destroyWin()),this,SLOT(MyAccept()));
}

MainPopDialog::~MainPopDialog()
{
    delete ui;
}

void MainPopDialog::AddContractsInfo(IF2UnPacker *lpUnPacker){
    ((SelfMarketDialog*)m_pSelfMarketDlg)->AddContractsInfo(lpUnPacker);
}
void MainPopDialog::SubscribeContractsChoosed(){
    ((SelfMarketDialog*)m_pSelfMarketDlg)->SubscribeContractsChoosed();
}
void MainPopDialog::MyAccept(){
    this->accept();
}
